/**
 *  @FileName: ExceptTest.java
 *  @Last Modified Date: CharlW
 *  @Description: 当代码试图访问数组的第三个元素的时候就会抛出一个异常
 */

import java.io.*;

public class ExceptTest {
	public static void main(String[] args) {
		try {
			int[] a = new int[2];
			System.out.println("Access element three: " + a[3]);
		} catch(ArrayIndexOutOfBoundsException e) {
			System.out.println("Exception thrown: " + e);
		}
		System.out.println("Out of the the block");
	}
}